package com.asia5b.a5mall.middleware.model.member

import com.asia5b.a5bmall.resource.ResString
import com.asia5b.a5mall.middleware.R
import com.asia5b.a5mall.middleware.model.bean.CommentMultiItemEntity
import com.asia5b.a5mall.middleware.utils.ObserableString
import com.luck.picture.lib.entity.LocalMedia
import java.io.Serializable

class CommentsModel : CommentMultiItemEntity(), Serializable {
    var comment_id = 0
    var goods_id = 0
    var sku_id = 0
    var seller_id = 0
    var status = 0//评论状态
    var grade = "good"//评论状态

    var gradeText = ""
        get() {
            when (grade) {
                "good" -> {
                    return ResString.get(R.string.好评)
                }
                "neutral" -> {
                    return ResString.get(R.string.中评)
                }
                else -> {//bad
                    return ResString.get(R.string.差评)
                }
            }
        }
    var audit_status=""

    var statusText = ""
        //评论状态
        get() {
            when (audit_status) {
                "WAIT_AUDIT" -> {//等待审核
                    return ResString.get(R.string.等待审核)
                }
                "PASS_AUDIT" -> {//审核通过
                    return ResString.get(R.string.审核通过)
                }
                "REFUSE_AUDIT" -> {//审核拒绝
                    return ResString.get(R.string.审核拒绝)
                }
            }
            return return ResString.get(R.string.审核通过)
        }
    var content = ""

    var goods_name = ""

    //商品其中一个图片
    var thumbnail: String? = null
        get() {
            return goods_images?.thumbnail
        }
    var goods_images: GoodsImageBean? = null
    var create_time = 0L

    inner class GoodsImageBean : Serializable {
        var thumbnail = ""
    }

    var commentContent = ObserableString("")
    var selectionMedia: ArrayList<LocalMedia>? = null

}


/*
{
"comment_id": 585,
"goods_id": 7177,
"sku_id": 22785,
"member_id": 2,
"seller_id": 34,
"member_name": "javashop",
"member_face": "http:\/\/47.88.173.86:82\/testShopImg\/20191210\/89DA2673
"goods_name": "方便实用时尚好看便当盒",
"content": "此商品默认好评",
"create_time": 1578672002,
"have_image": 0,
"status": 1,
"grade": "good",
"order_sn": "20200110000004",
"reply_status": 0,
"audit_status": "PASS_AUDIT",
"comments_type": "INITIAL",
"parent_id": 0,
"images": null,
"reply": null,
"additional_comment": null,
"goods_images": {
    "img_id": 16204,
    "goods_id": 7177,
    "thumbnail": "https:\/\/javashopa.oss-cn-shenzhen.aliyuncs.com\/javas
    "small": "https:\/\/javashopa.oss-cn-shenzhen.aliyuncs.com\/javashopa
    "big": "https:\/\/javashopa.oss-cn-shenzhen.aliyuncs.com\/javashopago
    "original": "https:\/\/javashopa.oss-cn-shenzhen.aliyuncs.com\/javash
    "tiny": null,
    "isdefault": 1,
    "sort": 0
},
"member_shop_score": null
 */